{% extends 'core/panels/panel.html' %}
{% load distro_tracker_extras %}

{% block panel-header %}
<div class="row">
<div class="col-xs-12">
    {{ panel.title }}
    {% if panel.context.external_resources %}
    {% for external in panel.context.external_resources %}
    <a class="m-l-1" href="{{ external.url }}">
        {% octicon 'link-external' external.description %}
    </a>
    {% endfor %}
    {% endif %}
    {% with versions=panel.context.version_info %}
    <div class="pull-xs-right">
	{% if versions.default_pool_url %}
	<a href="{{ versions.default_pool_url }}">{% octicon 'file-directory' 'pool directory' %}</a>
	{% endif %}
    </div>
    {% endwith %}
</div>
</div>
{% endblock %}
{% block panel-body %}
<ul class="list-group list-group-flush">
{% with versions=panel.context.version_info %}
    {% for item in versions.version_list %}
    <li class="list-group-item">
	<span class="list-item-key versions-repository" title="{{ item.repository.name }} ({{item.repository.codename }}{% if item.repository.suite != item.repository.codename %} / {{ item.repository.suite }}{% endif %})">
	    <b>{{ item.repository.shorthand }}:</b>
	</span>
	{% with url=item.url|default:"#" %}
	<a href="{{ url }}">{{ item.version }}</a>
	{% endwith %}
    </li>
    {% endfor %}
{% endwith %}

    {# Add any vendor provided versions #}
    {% for item in panel.context.vendor_versions %}
    <li class="list-group-item">
        <span class="list-item-key versions-repository">
            {% if item.repository_link %}<a href="{{ item.repository_link }}">{% endif %}
            <span title="waiting in the NEW queue for FTP master review"><b>{{ item.repository_shorthand }}:</b></span>
            {% if item.repository_link %}</a>{% endif %}
        </span>
	{% if item.version_link %}<a href="{{ item.version_link }}">{% endif %}
	<span>{{ item.version }}</span>
	{% if item.version_link %}</a> {% endif %}
    </li>
    {% endfor %}
</ul>
{% endblock %}
